local m = require('utils.vim')
local e = require('utils.editor')

require("treesitter-context").disable()
vim.wo.wrap = true

local do_show_outline = function()
    require('telescope.builtin').current_buffer_fuzzy_find({
        default_text='## ',
        prompt_title='md-outline',
        initial_mode = 'normal',
    })
end
m.local_map("n","<space>o",do_show_outline,{desc="show outline"})

-- 对齐表格内容
-- Thanks: https://www.reddit.com/r/vim/comments/10q8f4f/tip_reformat_a_markdown_table/
local cmd = "!column -s'|' -o'|' -t"

m.local_map("v", ",t", function()
	local right_keypresses = string.rep("\\<Right>",5)
    local k = ":" .. right_keypresses .. cmd .. "\\<Enter>"
    e.send_key(k)
end,{desc="align table content"})

-- EOP
